﻿USE [master]
GO
/****** Object:  Database [DLM]    Script Date: 07/26/2012 19:44:54 ******/
CREATE DATABASE [DLM] ON  PRIMARY 
( NAME = N'DLM', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
 LOG ON 
( NAME = N'DLM_log', FILENAME = N'D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\DLM_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [DLM].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [DLM] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [DLM] SET ANSI_NULLS OFF
GO
ALTER DATABASE [DLM] SET ANSI_PADDING OFF
GO
ALTER DATABASE [DLM] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [DLM] SET ARITHABORT OFF
GO
ALTER DATABASE [DLM] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [DLM] SET AUTO_CREATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [DLM] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [DLM] SET CURSOR_DEFAULT  GLOBAL
GO
ALTER DATABASE [DLM] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [DLM] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [DLM] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [DLM] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [DLM] SET  DISABLE_BROKER
GO
ALTER DATABASE [DLM] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [DLM] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [DLM] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [DLM] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [DLM] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [DLM] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [DLM] SET  READ_WRITE
GO
ALTER DATABASE [DLM] SET RECOVERY FULL
GO
ALTER DATABASE [DLM] SET  MULTI_USER
GO
ALTER DATABASE [DLM] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [DLM] SET DB_CHAINING OFF
GO
EXEC sys.sp_db_vardecimal_storage_format N'DLM', N'ON'
GO
USE [DLM]
GO
/****** Object:  Table [dbo].[Log]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Log](
	[Id] [int] IDENTITY(1,1) NOT NULL,
	[Date] [datetime] NOT NULL,
	[Thread] [varchar](255) NOT NULL,
	[Level] [varchar](50) NOT NULL,
	[Logger] [varchar](255) NOT NULL,
	[Message] [varchar](4000) NOT NULL,
	[Exception] [varchar](2000) NULL
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Log] ON
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (1, CAST(0x0000A098011614B2 AS DateTime), N'12', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (4, CAST(0x0000A09900C277F5 AS DateTime), N'6', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (5, CAST(0x0000A09900EB512F AS DateTime), N'29', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (6, CAST(0x0000A09900F728A9 AS DateTime), N'6', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (7, CAST(0x0000A09900FC0289 AS DateTime), N'23', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (8, CAST(0x0000A099010201CD AS DateTime), N'23', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (9, CAST(0x0000A09901116C2C AS DateTime), N'23', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (10, CAST(0x0000A0990111CFC7 AS DateTime), N'10', N'INFO', N'DLMLogger', N'Cannot redirect after HTTP headers have been sent.', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (11, CAST(0x0000A09901146C5A AS DateTime), N'10', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (12, CAST(0x0000A09A010C37EB AS DateTime), N'5', N'INFO', N'DLMLogger', N'Application start!', N'')
INSERT [dbo].[Log] ([Id], [Date], [Thread], [Level], [Logger], [Message], [Exception]) VALUES (13, CAST(0x0000A09A011C477E AS DateTime), N'5', N'INFO', N'DLMLogger', N'Application start!', N'')
SET IDENTITY_INSERT [dbo].[Log] OFF
/****** Object:  Table [dbo].[Remark]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Remark](
	[RemarkID] [int] IDENTITY(1,1) NOT NULL,
	[PartyID] [int] NOT NULL,
	[UserID] [int] NOT NULL,
	[Content] [nvarchar](100) NULL,
	[Rate] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Remark] PRIMARY KEY CLUSTERED 
(
	[RemarkID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Remark] ON
INSERT [dbo].[Remark] ([RemarkID], [PartyID], [UserID], [Content], [Rate], [CreateDate]) VALUES (1, 2, 2, N'dd', 7, CAST(0x0000A099010AEF94 AS DateTime))
INSERT [dbo].[Remark] ([RemarkID], [PartyID], [UserID], [Content], [Rate], [CreateDate]) VALUES (4, 1, 1, N'dfdf', 7, CAST(0x0000A09901153CA9 AS DateTime))
INSERT [dbo].[Remark] ([RemarkID], [PartyID], [UserID], [Content], [Rate], [CreateDate]) VALUES (5, 1, 1, N'dfdf', 100, CAST(0x0000A09901157B7D AS DateTime))
SET IDENTITY_INSERT [dbo].[Remark] OFF
/****** Object:  Table [dbo].[AdminUser]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminUser](
	[AdminID] [int] IDENTITY(1,1) NOT NULL,
	[Administrator] [nvarchar](30) NOT NULL,
	[Password] [varchar](max) NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_AdminUser] PRIMARY KEY CLUSTERED 
(
	[AdminID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[AdminUser] ON
INSERT [dbo].[AdminUser] ([AdminID], [Administrator], [Password], [CreateDate]) VALUES (4, N'administrator', N'mUK+Q2FWQMxRAqAAXJHJmw==', CAST(0x0000A08F013D02B3 AS DateTime))
SET IDENTITY_INSERT [dbo].[AdminUser] OFF
/****** Object:  Table [dbo].[AdminLog]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AdminLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[Action] [nvarchar](20) NOT NULL,
	[ActionDate] [datetime] NOT NULL,
	[ActionSourceIP] [varchar](20) NULL,
 CONSTRAINT [PK_AdminLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Account]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Account](
	[AccountID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Password] [varchar](max) NOT NULL,
	[Email] [varchar](30) NOT NULL,
	[ActiveCode] [varchar](50) NOT NULL,
	[IsActive] [bit] NOT NULL,
	[IsValidation] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Account] PRIMARY KEY CLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Account] ON
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (1, N'weiwei', N'mUK+Q2FWQMxRAqAAXJHJmw==', N'oyjd614@163.com', N'e050e51b-21f4-4a7d-b337-f3f655f1bcf5', 1, 1, CAST(0x0000A09701547B4E AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (2, N'chencaixia', N'mUK+Q2FWQMxRAqAAXJHJmw==', N'oyjd614@163.com', N'73c7bfd5-29b1-4f33-9393-596dee5fd305', 1, 1, CAST(0x0000A09800B2908E AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (3, N'tommy001', N'mUK+Q2FWQMxRAqAAXJHJmw==', N'oyjd614@gmail.com', N'f073cfb1-d2c9-4210-b4fc-62c75a712fb6', 1, 1, CAST(0x0000A09800D454CB AS DateTime))
INSERT [dbo].[Account] ([AccountID], [AccountName], [Password], [Email], [ActiveCode], [IsActive], [IsValidation], [CreateDate]) VALUES (4, N'tommy002', N'mUK+Q2FWQMxRAqAAXJHJmw==', N'oyjd614@163.com', N'7b7eb63f-5b71-4f67-bfee-d1039ee0f13e', 1, 1, CAST(0x0000A09800D6CB5F AS DateTime))
SET IDENTITY_INSERT [dbo].[Account] OFF
/****** Object:  Table [dbo].[EmailInvitation]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EmailInvitation](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[UserID] [int] NOT NULL,
	[Email] [varchar](25) NOT NULL,
	[Content] [ntext] NULL,
	[PartyID] [int] NOT NULL,
	[PartySubject] [nvarchar](30) NULL,
	[IsSent] [bit] NOT NULL,
	[SendDate] [datetime] NOT NULL,
 CONSTRAINT [PK_EmailInvitation] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[Country]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Country](
	[ID] [int] IDENTITY(1,1) NOT NULL,
	[Country] [nvarchar](15) NULL,
	[Province] [nvarchar](15) NULL,
	[City] [nvarchar](10) NULL,
	[Zone] [nvarchar](10) NULL,
	[Town] [nvarchar](30) NULL,
	[ParentId] [int] NULL,
 CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED 
(
	[ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Country] ON
INSERT [dbo].[Country] ([ID], [Country], [Province], [City], [Zone], [Town], [ParentId]) VALUES (1, N'中国', N'上海', N'上海', N'浦东新区', N'张江镇', NULL)
INSERT [dbo].[Country] ([ID], [Country], [Province], [City], [Zone], [Town], [ParentId]) VALUES (2, N'中国', N'上海', N'上海', N'浦东新区', N'塘镇', NULL)
INSERT [dbo].[Country] ([ID], [Country], [Province], [City], [Zone], [Town], [ParentId]) VALUES (3, N'中国', N'上海', N'上海', N'闵行', N'', NULL)
INSERT [dbo].[Country] ([ID], [Country], [Province], [City], [Zone], [Town], [ParentId]) VALUES (4, N'中国', N'新疆', N'乌鲁木齐', N'天山区', NULL, NULL)
SET IDENTITY_INSERT [dbo].[Country] OFF
/****** Object:  Table [dbo].[BreakAppointment]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BreakAppointment](
	[BID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_BreakAppointment] PRIMARY KEY CLUSTERED 
(
	[BID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BonusRule]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BonusRule](
	[RuleID] [int] IDENTITY(1,1) NOT NULL,
	[TemporaryDistrain] [decimal](10, 2) NULL,
	[Distrain] [decimal](10, 2) NULL,
	[Drop] [decimal](10, 2) NULL,
	[Rate] [decimal](10, 2) NULL,
	[Publish] [decimal](10, 2) NULL,
	[Inviite] [decimal](10, 2) NULL,
 CONSTRAINT [PK_BonusRule] PRIMARY KEY CLUSTERED 
(
	[RuleID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[BonusLog]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[BonusLog](
	[LogID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NULL,
	[Bonus] [decimal](10, 2) NULL,
	[Desc] [nvarchar](35) NULL,
	[CreateDate] [datetime] NULL,
 CONSTRAINT [PK_BonusLog] PRIMARY KEY CLUSTERED 
(
	[LogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[BonusLog] ON
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (1, 2, 2, CAST(-15.00 AS Decimal(10, 2)), NULL, CAST(0x0000A09800B421EF AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (2, 2, 0, CAST(-2.00 AS Decimal(10, 2)), NULL, CAST(0x0000A09800B492D5 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (3, 2, 0, CAST(-2.00 AS Decimal(10, 2)), NULL, CAST(0x0000A09800B4935F AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (4, 2, 0, CAST(-2.00 AS Decimal(10, 2)), NULL, CAST(0x0000A09800B493F5 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (5, 2, 0, CAST(-2.00 AS Decimal(10, 2)), NULL, CAST(0x0000A09800B49498 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (6, 1, 4, CAST(-15.00 AS Decimal(10, 2)), NULL, CAST(0x0000A098015C839D AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (7, 1, 4, CAST(65.00 AS Decimal(10, 2)), NULL, CAST(0x0000A0990106E49E AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (8, 1, 2, CAST(63.00 AS Decimal(10, 2)), NULL, CAST(0x0000A0990106F8E5 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (9, 1, 2, CAST(63.00 AS Decimal(10, 2)), NULL, CAST(0x0000A0990106F8E5 AS DateTime))
INSERT [dbo].[BonusLog] ([LogID], [UserID], [PartyID], [Bonus], [Desc], [CreateDate]) VALUES (10, 1, 1, CAST(76.00 AS Decimal(10, 2)), NULL, CAST(0x0000A099010703E7 AS DateTime))
SET IDENTITY_INSERT [dbo].[BonusLog] OFF
/****** Object:  Table [dbo].[PartyType]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PartyType](
	[PID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](20) NOT NULL,
	[Type] [int] NOT NULL,
 CONSTRAINT [PK_PartyType] PRIMARY KEY CLUSTERED 
(
	[PID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[PartyType] ON
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (1, N'体育活动', 0)
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (2, N'单身男女', 1)
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (3, N'老乡活动', 2)
INSERT [dbo].[PartyType] ([PID], [Name], [Type]) VALUES (4, N'其他', 3)
SET IDENTITY_INSERT [dbo].[PartyType] OFF
/****** Object:  Table [dbo].[Party]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Party](
	[PartyID] [int] IDENTITY(1,1) NOT NULL,
	[Status] [int] NOT NULL,
	[PartyType] [int] NOT NULL,
	[Subject] [nvarchar](30) NOT NULL,
	[Content] [ntext] NULL,
	[PhotoUrl] [nvarchar](20) NULL,
	[Modality] [nvarchar](20) NULL,
	[PartyDate] [datetime] NULL,
	[Location] [nvarchar](100) NULL,
	[Address] [nvarchar](150) NULL,
	[Area] [nvarchar](50) NULL,
	[MemberCount] [int] NULL,
	[Expense] [decimal](10, 2) NULL,
	[PaymentType] [int] NOT NULL,
	[EndDate] [datetime] NOT NULL,
	[IsSuccess] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Party] PRIMARY KEY CLUSTERED 
(
	[PartyID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Party] ON
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [MemberCount], [Expense], [PaymentType], [EndDate], [IsSuccess], [CreateDate]) VALUES (1, 1, 0, N'dfdf', N'dfdfdfdf', NULL, N'dfdf', CAST(0x0000A097017801D0 AS DateTime), N'dfdf', N'其他', N'', 22, CAST(222.00 AS Decimal(10, 2)), 1, CAST(0x0000A097017801D0 AS DateTime), 1, CAST(0x0000A0970178448D AS DateTime))
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [MemberCount], [Expense], [PaymentType], [EndDate], [IsSuccess], [CreateDate]) VALUES (2, 1, 1, N'dd', N'dd', NULL, N'dd', CAST(0x0000A09C00AF3B60 AS DateTime), N'ee', N'其他', N'', 22, CAST(222.00 AS Decimal(10, 2)), 1, CAST(0x0000A09E00681870 AS DateTime), 1, CAST(0x0000A09800A5326C AS DateTime))
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [MemberCount], [Expense], [PaymentType], [EndDate], [IsSuccess], [CreateDate]) VALUES (3, 2, 1, N'dfdf', N'dfd', NULL, N'dfdf', CAST(0x0000A09C00000000 AS DateTime), N'dfdf', N'其他', N'', 22, CAST(22.00 AS Decimal(10, 2)), 1, CAST(0x0000A09800000000 AS DateTime), 0, CAST(0x0000A09800DA0AF5 AS DateTime))
INSERT [dbo].[Party] ([PartyID], [Status], [PartyType], [Subject], [Content], [PhotoUrl], [Modality], [PartyDate], [Location], [Address], [Area], [MemberCount], [Expense], [PaymentType], [EndDate], [IsSuccess], [CreateDate]) VALUES (4, 2, 1, N'dfdf', N'dfd', NULL, N'dfdf', CAST(0x0000A09800DAE710 AS DateTime), N'fdf', N'其他', N'', 22, CAST(22.00 AS Decimal(10, 2)), 1, CAST(0x0000A09C00DAE710 AS DateTime), 0, CAST(0x0000A09800DB1480 AS DateTime))
SET IDENTITY_INSERT [dbo].[Party] OFF
/****** Object:  Table [dbo].[Notice]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Notice](
	[NoticeID] [int] IDENTITY(1,1) NOT NULL,
	[Subject] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Notice] PRIMARY KEY CLUSTERED 
(
	[NoticeID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Modality]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Modality](
	[MID] [int] IDENTITY(1,1) NOT NULL,
	[PID] [int] NOT NULL,
	[Name] [nvarchar](20) NOT NULL,
 CONSTRAINT [PK_Modality] PRIMARY KEY CLUSTERED 
(
	[MID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Modality] ON
INSERT [dbo].[Modality] ([MID], [PID], [Name]) VALUES (3, 2, N'dd')
INSERT [dbo].[Modality] ([MID], [PID], [Name]) VALUES (5, 3, N'dfdf')
INSERT [dbo].[Modality] ([MID], [PID], [Name]) VALUES (9, 1, N'KTV')
SET IDENTITY_INSERT [dbo].[Modality] OFF
/****** Object:  Table [dbo].[User]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[User](
	[UserID] [int] IDENTITY(1,1) NOT NULL,
	[AccountID] [int] NOT NULL,
	[AccountName] [nvarchar](25) NOT NULL,
	[Name] [nvarchar](20) NULL,
	[Gender] [bit] NULL,
	[Birthday] [datetime] NULL,
	[Age] [smallint] NULL,
	[Location] [nvarchar](20) NULL,
	[HomePlace] [nvarchar](30) NULL,
	[Marriage] [nvarchar](8) NULL,
	[NativePlace] [nvarchar](40) NULL,
	[Stature] [nvarchar](10) NULL,
	[Weight] [int] NULL,
	[Education] [nvarchar](10) NULL,
	[Job] [nvarchar](20) NULL,
	[Income] [nvarchar](15) NULL,
	[Position] [nvarchar](20) NULL,
	[Industry] [nvarchar](50) NULL,
	[Car] [nvarchar](10) NULL,
	[Parents] [nvarchar](20) NULL,
	[Photo] [nvarchar](50) NULL,
	[Phone] [varchar](15) NULL,
	[IM] [varchar](18) NULL,
	[Introduction] [nvarchar](300) NULL,
	[IsValidation] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_User_AccountID] UNIQUE NONCLUSTERED 
(
	[AccountID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[User] ON
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [Introduction], [IsValidation], [CreateDate]) VALUES (1, 1, N'weiwei', N'dfdf', 0, CAST(0x0000A09200000000 AS DateTime), 30, N'dfdf', NULL, N'未婚', N'ffffffffffff', N'170', 60, N'硕士', N'dfd', N'10000-20000', NULL, NULL, N'请选择', N'请选择', N'tj0zzebh.0bz.jpg', NULL, NULL, NULL, 1, CAST(0x0000A09701547B55 AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [Introduction], [IsValidation], [CreateDate]) VALUES (2, 2, N'chencaixia', N'彩霞', 1, CAST(0x0000787200000000 AS DateTime), 28, N'上海 上海 浦东新区', NULL, N'未婚', N'上海', N'160', 50, N'硕士', N'工程师', N'5000-10000', NULL, NULL, NULL, NULL, N'dccunllc.24a.jpg', N'18217229563', NULL, NULL, 1, CAST(0x0000A09800B2908E AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [Introduction], [IsValidation], [CreateDate]) VALUES (3, 3, N'tommy001', N'ddf', 0, CAST(0x0000A08C00000000 AS DateTime), 28, N'新疆 乌鲁木齐 天山区', NULL, N'已婚', N'df', N'11', 11, N'请选择', N'11', N'10000-20000', NULL, NULL, N'请选择', N'请选择', N'ucsdqbod.fbt.jpg', NULL, NULL, NULL, 1, CAST(0x0000A09800D454CB AS DateTime))
INSERT [dbo].[User] ([UserID], [AccountID], [AccountName], [Name], [Gender], [Birthday], [Age], [Location], [HomePlace], [Marriage], [NativePlace], [Stature], [Weight], [Education], [Job], [Income], [Position], [Industry], [Car], [Parents], [Photo], [Phone], [IM], [Introduction], [IsValidation], [CreateDate]) VALUES (4, 4, N'tommy002', N'dfdf', 1, CAST(0x0000A09500000000 AS DateTime), 27, N'新疆 乌鲁木齐 天山区', NULL, N'未婚', N'dfdf', N'11', 11, N'硕士', N'11', N'10000-20000', NULL, NULL, NULL, NULL, N'none_75_75.png', N'18217229563', NULL, NULL, 1, CAST(0x0000A09800D6CB5F AS DateTime))
SET IDENTITY_INSERT [dbo].[User] OFF
/****** Object:  Table [dbo].[UserView]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserView](
	[ViewID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[IP] [varchar](20) NULL,
	[ViewDate] [datetime] NOT NULL,
 CONSTRAINT [PK_UserView] PRIMARY KEY CLUSTERED 
(
	[ViewID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[UserView] ON
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (1, 2, N'::1', CAST(0x0000A09800B5B7BE AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (2, 1, N'::1', CAST(0x0000A09900D9DFA5 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (3, 2, N'::1', CAST(0x0000A09901086E9E AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (4, 2, N'::1', CAST(0x0000A0990111A673 AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (5, 2, N'::1', CAST(0x0000A0990111D11F AS DateTime))
INSERT [dbo].[UserView] ([ViewID], [UserID], [IP], [ViewDate]) VALUES (6, 2, N'::1', CAST(0x0000A09901127D7D AS DateTime))
SET IDENTITY_INSERT [dbo].[UserView] OFF
/****** Object:  Table [dbo].[UserPartyAssociation]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[UserPartyAssociation](
	[UPAID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsLead] [int] NOT NULL,
	[AssociationDate] [datetime] NOT NULL,
 CONSTRAINT [PK_UserPartyAssociation] PRIMARY KEY CLUSTERED 
(
	[UPAID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] ON
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (1, 1, 1, 1, CAST(0x0000A09701784494 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (2, 1, 2, 1, CAST(0x0000A09800A53274 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (3, 2, 2, 0, CAST(0x0000A09800B421D1 AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (4, 4, 3, 1, CAST(0x0000A09800DA0AFD AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (5, 3, 4, 1, CAST(0x0000A09800DB148B AS DateTime))
INSERT [dbo].[UserPartyAssociation] ([UPAID], [UserID], [PartyID], [IsLead], [AssociationDate]) VALUES (6, 1, 4, 0, CAST(0x0000A098015C8348 AS DateTime))
SET IDENTITY_INSERT [dbo].[UserPartyAssociation] OFF
/****** Object:  Table [dbo].[Photo]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Photo](
	[PhotoID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Url] [nvarchar](30) NULL,
	[Desc] [nvarchar](20) NULL,
	[IsMain] [bit] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Photo] PRIMARY KEY CLUSTERED 
(
	[PhotoID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Invitation]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Invitation](
	[InvitationID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[PartyID] [int] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
	[SenderID] [int] NOT NULL,
	[SenderAccount] [nvarchar](25) NOT NULL,
	[InviteDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Invitation] PRIMARY KEY CLUSTERED 
(
	[InvitationID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Friend]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Friend](
	[FriendID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NULL,
	[MyFriendID] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
	[IsConfirmed] [bit] NOT NULL,
 CONSTRAINT [PK_Friend] PRIMARY KEY CLUSTERED 
(
	[FriendID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Friend] ON
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (1, 1, 2, CAST(0x0000A09800B456B1 AS DateTime), 1)
INSERT [dbo].[Friend] ([FriendID], [UserID], [MyFriendID], [CreateDate], [IsConfirmed]) VALUES (2, 2, 1, CAST(0x0000A09800B48512 AS DateTime), 1)
SET IDENTITY_INSERT [dbo].[Friend] OFF
/****** Object:  Table [dbo].[Supplier]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Supplier](
	[SID] [int] IDENTITY(1,1) NOT NULL,
	[MID] [int] NOT NULL,
	[Name] [nvarchar](30) NOT NULL,
	[Address] [ntext] NULL,
	[Phone] [varchar](20) NULL,
	[Order] [int] NOT NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Supplier] PRIMARY KEY CLUSTERED 
(
	[SID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
SET IDENTITY_INSERT [dbo].[Supplier] ON
INSERT [dbo].[Supplier] ([SID], [MID], [Name], [Address], [Phone], [Order], [CreateDate]) VALUES (1, 3, N'dd', N'dd', N'dd', 1, CAST(0x0000A09801164CAA AS DateTime))
INSERT [dbo].[Supplier] ([SID], [MID], [Name], [Address], [Phone], [Order], [CreateDate]) VALUES (4, 9, N'dfd', N'dd', N'dd', 1, CAST(0x0000A098015F5BB1 AS DateTime))
INSERT [dbo].[Supplier] ([SID], [MID], [Name], [Address], [Phone], [Order], [CreateDate]) VALUES (5, 9, N'ddf', N'ff', N'ff', 2, CAST(0x0000A098015F6122 AS DateTime))
SET IDENTITY_INSERT [dbo].[Supplier] OFF
/****** Object:  Table [dbo].[Salutation]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Salutation](
	[SID] [int] IDENTITY(1,1) NOT NULL,
	[Type] [int] NOT NULL,
	[UserID] [int] NOT NULL,
	[GreetID] [int] NOT NULL,
	[Message] [nvarchar](20) NULL,
	[IsConfirm] [bit] NOT NULL,
	[SentDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Salutation] PRIMARY KEY CLUSTERED 
(
	[SID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Salutation] ON
INSERT [dbo].[Salutation] ([SID], [Type], [UserID], [GreetID], [Message], [IsConfirm], [SentDate]) VALUES (1, 0, 1, 2, N'', 1, CAST(0x0000A09800B45E93 AS DateTime))
SET IDENTITY_INSERT [dbo].[Salutation] OFF
/****** Object:  Table [dbo].[Message]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Message](
	[MessageID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Title] [nvarchar](20) NOT NULL,
	[Content] [ntext] NULL,
	[IsRead] [bit] NOT NULL,
	[Source] [nvarchar](20) NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Message] PRIMARY KEY CLUSTERED 
(
	[MessageID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Message] ON
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (1, 2, N'会员weiwei加您为好友', N'会员weiwei 加您为好友,快去看看吧', 0, N'好友', CAST(0x0000A09800B456C8 AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (2, 2, N'weiwei的招呼', N'会员 weiwei 向您打招呼,快去看看吧', 1, N'打招呼', CAST(0x0000A09800B45E9B AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (3, 1, N'好友请求通过', N'您的好友请求被通过！', 0, N'好友', CAST(0x0000A09800B4851E AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (4, 2, N'招呼响应', N'', 0, N'打招呼', CAST(0x0000A09800B492BD AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (5, 2, N'招呼响应', N'', 0, N'打招呼', CAST(0x0000A09800B49352 AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (6, 2, N'招呼响应', N'', 1, N'打招呼', CAST(0x0000A09800B493E8 AS DateTime))
INSERT [dbo].[Message] ([MessageID], [UserID], [Title], [Content], [IsRead], [Source], [CreateDate]) VALUES (7, 2, N'招呼响应', N'', 1, N'打招呼', CAST(0x0000A09800B4948B AS DateTime))
SET IDENTITY_INSERT [dbo].[Message] OFF
/****** Object:  Table [dbo].[Bonus]    Script Date: 07/26/2012 19:44:55 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Bonus](
	[BonusID] [int] IDENTITY(1,1) NOT NULL,
	[UserID] [int] NOT NULL,
	[Bonus] [decimal](10, 2) NULL,
	[UpdateDate] [datetime] NULL,
	[CreateDate] [datetime] NOT NULL,
 CONSTRAINT [PK_Bonus] PRIMARY KEY CLUSTERED 
(
	[BonusID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY],
 CONSTRAINT [UQ_Bonus_UserID] UNIQUE NONCLUSTERED 
(
	[UserID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET IDENTITY_INSERT [dbo].[Bonus] ON
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (1, 1, CAST(76.00 AS Decimal(10, 2)), CAST(0x0000A098015C8385 AS DateTime), CAST(0x0000A09701547CA4 AS DateTime))
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (2, 2, CAST(38.00 AS Decimal(10, 2)), CAST(0x0000A09800B49494 AS DateTime), CAST(0x0000A09800B29133 AS DateTime))
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (3, 3, CAST(50.00 AS Decimal(10, 2)), CAST(0x0000A09800D4559D AS DateTime), CAST(0x0000A09800D4559D AS DateTime))
INSERT [dbo].[Bonus] ([BonusID], [UserID], [Bonus], [UpdateDate], [CreateDate]) VALUES (4, 4, CAST(50.00 AS Decimal(10, 2)), CAST(0x0000A09800D6CB76 AS DateTime), CAST(0x0000A09800D6CB76 AS DateTime))
SET IDENTITY_INSERT [dbo].[Bonus] OFF
/****** Object:  ForeignKey [FK_Modality_PartyType]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Modality]  WITH CHECK ADD  CONSTRAINT [FK_Modality_PartyType] FOREIGN KEY([PID])
REFERENCES [dbo].[PartyType] ([PID])
GO
ALTER TABLE [dbo].[Modality] CHECK CONSTRAINT [FK_Modality_PartyType]
GO
/****** Object:  ForeignKey [FK_User_Account]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[User]  WITH CHECK ADD  CONSTRAINT [FK_User_Account] FOREIGN KEY([AccountID])
REFERENCES [dbo].[Account] ([AccountID])
GO
ALTER TABLE [dbo].[User] CHECK CONSTRAINT [FK_User_Account]
GO
/****** Object:  ForeignKey [FK_UserView_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[UserView]  WITH CHECK ADD  CONSTRAINT [FK_UserView_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserView] CHECK CONSTRAINT [FK_UserView_User]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_Party]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_Party] FOREIGN KEY([PartyID])
REFERENCES [dbo].[Party] ([PartyID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_Party]
GO
/****** Object:  ForeignKey [FK_UserPartyAssociation_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[UserPartyAssociation]  WITH CHECK ADD  CONSTRAINT [FK_UserPartyAssociation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[UserPartyAssociation] CHECK CONSTRAINT [FK_UserPartyAssociation_User]
GO
/****** Object:  ForeignKey [FK_Photo_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Photo]  WITH CHECK ADD  CONSTRAINT [FK_Photo_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Photo] CHECK CONSTRAINT [FK_Photo_User]
GO
/****** Object:  ForeignKey [FK_Invitation_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Invitation]  WITH CHECK ADD  CONSTRAINT [FK_Invitation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Invitation] CHECK CONSTRAINT [FK_Invitation_User]
GO
/****** Object:  ForeignKey [FK_Friend_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Friend]  WITH CHECK ADD  CONSTRAINT [FK_Friend_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Friend] CHECK CONSTRAINT [FK_Friend_User]
GO
/****** Object:  ForeignKey [FK_Supplier_Modality]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Supplier]  WITH CHECK ADD  CONSTRAINT [FK_Supplier_Modality] FOREIGN KEY([MID])
REFERENCES [dbo].[Modality] ([MID])
GO
ALTER TABLE [dbo].[Supplier] CHECK CONSTRAINT [FK_Supplier_Modality]
GO
/****** Object:  ForeignKey [FK_Salutation_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Salutation]  WITH CHECK ADD  CONSTRAINT [FK_Salutation_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Salutation] CHECK CONSTRAINT [FK_Salutation_User]
GO
/****** Object:  ForeignKey [FK_Message_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Message]  WITH CHECK ADD  CONSTRAINT [FK_Message_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Message] CHECK CONSTRAINT [FK_Message_User]
GO
/****** Object:  ForeignKey [FK_Bonus_User]    Script Date: 07/26/2012 19:44:55 ******/
ALTER TABLE [dbo].[Bonus]  WITH CHECK ADD  CONSTRAINT [FK_Bonus_User] FOREIGN KEY([UserID])
REFERENCES [dbo].[User] ([UserID])
GO
ALTER TABLE [dbo].[Bonus] CHECK CONSTRAINT [FK_Bonus_User]
GO
